package element;

import java.awt.*;

/**
 * @author 邓哈哈
 * 2023/2/20 19:57
 * Function: 公共实体类
 * Version 1.0
 */

public class MyObject {
    //图片
    Image img;
    //坐标
    int x;
    int y;
    //尺寸
    int width;
    int height;
    //存活状态
    boolean alive;
    //质量
    int quality;
    //积分
    int count;
    //类型
    int type;

    /**
     * 绘制
     *
     * @param g
     */
    public void paintSelf(Graphics g) {
        g.drawImage(this.img, this.x, this.y, null);
    }

    /**
     * 获取矩形
     *
     * @return
     */
    public Rectangle getRec() {
        return new Rectangle(this.x, this.y, this.width, this.height);
    }

    public boolean isAlive() {
        return alive;
    }

    public int getCount() {
        return count;
    }

    public int getType() {
        return type;
    }
}














